/**
 * Created by jian on 2017/12/30.
 */
var testLevelResultList = [];

var chePing = {
    searchVal: '',
};

var view = {
    data: chePing,
    test:{testLevelResultList:testLevelResultList}
};

var vue_vm = new Vue({
    el: '#vue_vm',
    data: view,
    methods:{
        checkResult(item){
            var elderData = "elderId="+item.elderId+"&elderName="+item.elderForm.name+"&elderCard="+item.elderForm.cardId+"&testTimesNumber="+item.testTimesNumber;
            location.href = "2-2-1cheping-result.html?"+elderData;
        }
    }
});

var loginedUser = getLoginedUser();

function checkResult() {
    find_basic(path + '/elderTestRecord/find', view.data.searchVal, function (res) {
        // console.log(res);
        view.data = res.data[0];
        findTestLevelResultList(view.data.elderId);
    });
}

function openCePing() {
    var vd = view.data;
    var timesNumber = vd.timesNumber+1;
    var elderData = vd.elderId + "&elderCard=" +vd.elderCard  + "&elderName=" + vd.elderName + "&timesNumber=" + timesNumber;
    // console.log(elderData);
    location.href ='2-2-1cheping-1.html?elderId=' + elderData;
    // window.open('2-2-1cheping-1.html?elderId=' + elderData, '2-2-1cheping')
}

function  findTestLevelResultList(elderId) {
    find_basic_by_json(path + '/elderTestLevelRecord/findList', {
        "elderId": elderId,
    }, function (res) {
        view.test.testLevelResultList = res.data;
        $('#vue_vm_list div').show();
        $(".for_ie_div").show();
    });
}